package com.wxs.common.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.wxs.common.pojo.Resource;

/**
 * 菜单权限
 * 
 * @author zhucw
 *
 */
@Mapper
public interface ResourceMapper {
	int deleteByPrimaryKey(Integer id);

	int insert(Resource record);

	int insertSelective(Resource record);

	Resource selectByPrimaryKey(Integer id);

	Resource selectByName(String name);

	int updateByPrimaryKeySelective(Resource record);

	int updateByPrimaryKeyWithBLOBs(Resource record);

	int updateByPrimaryKey(Resource record);

	List<Resource> listResourceByGroupid(Integer id);

	List<Resource> listResourceByRoleid(Integer id);

	List<Resource> listAllByRoleid(Integer id);

	List<Resource> list();

	@Delete("delete from resource where id=#{id}")
	int deleteResource(@Param("id") Integer id);

	@Delete("delete from role_resource where resourceEntities_id=#{resource_id}")
	int deleteRole_Resource(@Param("resource_id") Integer resource_id);
}